package com.sesame.providerdemo.web;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.sesame.common.utils.ResponseBean;
import com.sesame.common.utils.ResponseUtils;
import com.sesame.providerdemo.entity.User;
import com.sesame.providerdemo.service.IFileService;
import com.sesame.providerdemo.service.IUserService;
import org.aspectj.util.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 所有的用户信息 前端控制器
 * </p>
 *
 * @author xiakeying
 * @since 2019-01-15
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @Autowired
    private IFileService fileService;

    @GetMapping(value = "/show")
    public Page<User> test(){
        Page<User> users = userService.selectPage(new Page<>(1,10));
        return users;
    }

    @GetMapping(value = "/getFileData")
    public ResponseBean getFileData(){
        List<String> lines = fileService.getFileData();
        return ResponseUtils.success(lines);
    }


}
